/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package admin.reportes;

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;

/**
 *
 * @author fjgimon
 */
public class CarpetaDescarga extends JPanel {

    JFileChooser chooser;
    String choosertitle = "Guardar archivo";
    private static final String name = "Carpeta Descarga";

    public CarpetaDescarga() {
    }

    public String ejecucion() {
        int result;
        String path = "";
        System.out.println("Se ejecuta");
        chooser = new JFileChooser();
        chooser.setDialogTitle(choosertitle);
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        //
        // disable the "All files" option.
        //

        chooser.setAcceptAllFileFilterUsed(false);
        //    
        if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            System.out.println("Salio jchooser");
            path = chooser.getSelectedFile().getAbsolutePath();
        } else {
            System.out.println("No Selection ");
        }
        System.out.println("Tengo el path");
        return path;
    }

    public Dimension getPreferredSize() {
        return new Dimension(200, 200);
    }
}
